package com.demo01_video.config;


import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

// kafka 配置类
@Configuration
public class KafkaConfig {

    @Bean
    public NewTopic videoPublishTopic() {
        return TopicBuilder.name("video-publish")
                .partitions(3)
                .replicas(1)
                .build();
    }
    
    @Bean
    public NewTopic feedPushTopic() {
        return TopicBuilder.name("feed-push")
                .partitions(10)
                .replicas(1)
                .build();
    }
    
    @Bean
    public NewTopic feedPushShardTopic() {
        return TopicBuilder.name("feed-push-shard")
                .partitions(20)
                .replicas(1)
                .build();
    }
}